home *** CD-ROM | disk | FTP | other *** search
- Path: ufrima.imag.fr!usenet
- From: dardaine emmanuel <edardain>
- Newsgroups: comp.lang.c++
- Subject: Re: A simple "find the bug" (please! I need help :)
- Date: 22 Feb 1996 11:29:19 GMT
- Organization: UFRIMA, IMAG, Universite Joseph Fourier
- Message-ID: <4ghk2f$3e7@ufrima.imag.fr>
- References: <4gdr6n$6p0@guava.epix.net>
- NNTP-Posting-Host: boole.imag.fr
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 5.4 sun4m)
- X-URL: news://news-ufrima/4gdr6n$6p0@guava.epix.net
-
- Hi,
-
- I noticed a few mistakes in your program :
- - first, you add num2 to num1 before you get the values of these variables. You
- should do the sum after your cin statements,
- - you want to print the value of result with cout but result is declared in
- getnums (and so, only valid for this function). That's why the compiler doesn't
- know this variable. You should do the "cout<<result" statement in your getnums
- function, or declare result as a global variable (just like you did for num1
- and num2),
- - you also can do "cout << getnums ();"
-
-
- Emmanuel
-
-